package com.framework.admin.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.framework.common.config.EntityUpdateListener;
import com.framework.common.listener.impl.BaseEntityUpdate;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Table;

@Data
@Table
@Entity
@EntityListeners(EntityUpdateListener.class)
@JsonIgnoreProperties(value = { "hibernateLazyInitializer"})
@EqualsAndHashCode(callSuper = true)
public class SysRole extends BaseEntityUpdate {
    @ApiModelProperty("上级角色")
    @Column(columnDefinition = "varchar(32) default '' COMMENT '上级角色'")
    private String pid;

    @ApiModelProperty("角色名称")
    @Column(columnDefinition = "varchar(50) default '' COMMENT '角色名称'")
    private String name;

    @ApiModelProperty("角色编码")
    @Column(columnDefinition = "varchar(10) default '' COMMENT '角色编码'")
    private String code;

    @ApiModelProperty("是否管理员")
    @Column(columnDefinition = "int(1) default 0 COMMENT '是否管理员'")
    private Integer isAdmin;

    @ApiModelProperty("是否超级管理员")
    @Column(columnDefinition = "int(1) default 0 COMMENT '是否超级管理员'")
    private Integer isSuperAdmin;


    @ApiModelProperty("数据范围")
    @Column(columnDefinition = "varchar(10) default '' COMMENT '数据范围'")
    private String dataScope;

    @ApiModelProperty("备注")
    @Column(columnDefinition = "varchar(100) default '' COMMENT '备注'")
    private String remark;

}
